Skip to content

AggLayer: Normalize storage slot naming#2521

Merged
mmagician merged 4 commits intoagglayerfrom
andrew-normalize-storage-slot-naming
Mar 18, 2026
Merged

AggLayer: Normalize storage slot naming#2521
mmagician merged 4 commits intoagglayerfrom
andrew-normalize-storage-slot-naming

Conversation

@Fumuran
Copy link
Contributor

@Fumuran Fumuran commented Feb 26, 2026

This PR updates the AggLayer storage slot names, namely:

  • Renames AggLayer storage slots and the assembly library namespace across MASM, Rust wrappers, and tests (e.g., agglayer::bridge::admin_account_id, agglayer::bridge::ger_map, agglayer::bridge::let_frontier) removing the miden:: prefix from the names, and updates component re-exports/note scripts to agglayer::*something*.
  • Updates build.rs to assemble the library as agglayer (instead of miden::agglayer) and aligns generated imports.
  • Syncs documentation in SPEC.md to use new names.

Closes: #2356

@Fumuran Fumuran added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Feb 26, 2026
@mmagician mmagician added agglayer PRs or issues related to AggLayer bridging integration pr-from-maintainers PRs that come from internal contributors or integration partners. They should be given priority labels Mar 1, 2026
@Fumuran Fumuran marked this pull request as ready for review March 2, 2026 14:50
Copy link
Collaborator

@mmagician mmagician left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on! Unfortunately I think this is one of those bike-sheddeable PRs, so let me go right at it 😁


There are some slots in bridge_config.masm, of which I think one deserves a rename (of the last component - I'd drop miden prefix from all of them as outlined in the other comments above):

const GER_STORAGE_SLOT=word("miden::agglayer::bridge::ger")

I'd change the name to indicate it's a map.

Regarding admin / ger_manager - we might want to be consistent w.r.t. this holding an account ID, similarly to bridge_id.
So maybe admin_id etc.? Alternatively, suffix all of them with _account_id instead for extra clarity.

# Storage slots
# The slot in this component's storage layout where the bridge account ID is stored.
const BRIDGE_ID_SLOT = word("miden::agglayer::faucet")
const BRIDGE_ID_SLOT = word("miden::agglayer::bridge::id")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as per the docs, we should follow:

project_name::component_name::slot_name

Here, I would make two modifications:

  • drop miden altogether (from all agglayer storage slots)
  • use bridge or faucet depending on which component this belongs to (e.g. particular one belongs to the faucet, but describes the bridge account ID. So overall I'd keep it as agglayer::faucet::bridge_id)

@Fumuran Fumuran requested a review from mmagician March 18, 2026 15:23
Copy link
Collaborator

@mmagician mmagician left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

// Fixed seed for deterministic "random" destination vectors.
// Keeping this constant ensures everyone regenerates the exact same JSON vectors.
uint256 constant VECTOR_SEED = uint256(keccak256("miden::agglayer::mmr_frontier_vectors::v2"));
uint256 constant VECTOR_SEED = uint256(keccak256("agglayer::mmr_frontier_vectors::v2"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol this change generates half the PR's diff due to regeneration of the JSON

@mmagician mmagician merged commit cb8ae4b into agglayer Mar 18, 2026
17 checks passed
@mmagician mmagician deleted the andrew-normalize-storage-slot-naming branch March 18, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agglayer PRs or issues related to AggLayer bridging integration no changelog This PR does not require an entry in the `CHANGELOG.md` file pr-from-maintainers PRs that come from internal contributors or integration partners. They should be given priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants